#pragma once

#include "../QRSWidgetBase.h"
#include "ui_RevolveOperationWidget.h"

#include "Render/QIVtkSelectionPipeline.h"

QT_BEGIN_NAMESPACE
namespace Ui { class RevolveOperationWidgetClass; };
QT_END_NAMESPACE

class MainWindow;
class ShapeOperation;

class RevolveOperationWidget : public QRSWidgetBase
{
	Q_OBJECT

public:
	RevolveOperationWidget(MainWindow* inMainWindow, ShapeOperation* inOperation = nullptr, QWidget* parent = nullptr);
	~RevolveOperationWidget();
protected:
	void OnSelectedSubShapes(QIVtkSelectionPipeline* actor);
	void closeEvent(QCloseEvent* event) override;
	bool eventFilter(QObject* obj, QEvent* event) override;
	void OnTargetComboIndexChange(int index);

	void OnModify();
	void OnConfirm();

	void onLeftButtonDown();
	void OnPickPosition(const gp_Pnt& position);
private:
	Ui::RevolveOperationWidgetClass *ui;
protected:
	bool bUseEdge = false;
	std::vector<std::reference_wrapper<const TopoDS_Shape>> m_shapelist;
	Handle(QIVtkSelectionPipeline) cacheActor;
	Handle(QIVtkSelectionPipeline) m_selectedActor;
	gp_Ax1 rotationAxis;
	float _angle = 0.f;
	int focusIndex = 0;

	std::vector<vtkSmartPointer<vtkActor>> selectTempActor;

	RWTripleFloatInput* m_dir;
    RWTripleFloatInput* m_center;
};
